package entity;

import java.util.HashMap;
import java.util.Map;

public class Poker {
	public static Map<Suit, Integer> suit2Color;
	static{
		suit2Color=new HashMap<>();
		suit2Color.put(Suit.Heart, 0);//红桃
		suit2Color.put(Suit.Diamond, 0);//红方片
		suit2Color.put(Suit.Club,1);//黑梅花
		suit2Color.put(Suit.Spade, 1);//黑桃
	}	//花色和颜色的映射，红色映射0，黑色映射1
	private int number;	//扑克数值
	private Suit suit;//扑克花色
	private boolean up;//扑克是否朝上
	public Poker(int number,Suit suit,boolean up) {
		this.number=number;
		this.suit=suit;
		this.up=up;
	}
	public Poker(int number,Suit suit){
		this(number,suit,false);
	}
	public int getNumber() {
		return number;
	}
	public void setNumber(int number) {
		this.number = number;
	}
	public Suit getSuit() {
		return suit;
	}
	public void setSuit(Suit suit) {
		this.suit = suit;
	}
	public boolean isUp() {
		return up;
	}
	public void setUp(boolean up) {
		this.up = up;
	}
	public String toString(){
		return new StringBuffer().append(Suit.values()[suit.ordinal()]).append(number).append(up?"正面朝上":"反面朝上").toString();
	}
	public static void main(String[] args) {
		Poker poker=new Poker(5, Suit.Diamond);
		System.out.println(poker);
	}
}
